Various embodiments relate to the problem of generating a periodic signal, for example a PWM (=pulse width modulation) signal with a frequency fsignal which is as high as possible and a frequency resolution which is as high as possible by means of a microcontroller using a frequency fosc which is as low as possible for an oscillator, which is coupled to the microcontroller.
In the field of lighting engineering, this problem occurs, for example, when starting a discharge lamp. That is to say that a high voltage which is generated by resonance is required for starting the discharge lamp. In the case of a conventional and inexpensive method, the resonant frequency or a harmonic of the resonant frequency of a resonant circuit is excited for this purpose. In order to blank all of the tolerances of the resonant circuit, the frequency is varied, i.e. swept. In order to meet the maximum which is subject to tolerances with a maximum error which is as low as possible, the resolution of the frequency increments needs to be correspondingly high. In another application, the switching frequency of the lamp current is varied in order to avoid resonant effects in the lamp. In another application, the switching frequency in an electronic circuit is varied in order to make the electric magnetic interference emission more broadband than in the case of a fixed switching frequency.
Time-dependent periodic signals are often generated by means of a microcontroller. In the process, the microcontroller is often clocked by an oscillator at a fixed frequency fOSC. By virtue of internal meters, for example so-called PWM units, periodic signals with a frequency fsignal which can be set or an on and off time which can be set can be generated therefrom and emitted by the microcontroller. In the prior art, the higher the frequency fsignal of a signal to be generated at a fixed available oscillator frequency fOSC, the lower the relative frequency resolution of the periodic signal to be generated will be.
One example will be used to explain this: the oscillator frequency fOSC is 10 MHz, i.e. one period of oscillation is 100 ns. In the case of a signal to be generated with the frequency fsignal=10 kHz, a period of oscillation comprises 100 μs. Therefore, a period of oscillation comprises 1000 ticks of the clock of the oscillator frequency. The relative frequency resolution is thus 1/1000=0.1%. If, however, a signal with a frequency fsignal of 1 MHz is to be generated, the period of oscillation is 1 μs and therefore now only 10 ticks of the clock predetermined by the oscillator frequency fOSC. The relative frequency resolution is therefore reduced to 1/10=10%. In the prior art, therefore, the relative resolution is proportional to the ratio of fOSC/fsignal. The lower this ratio is, the lower the relative frequency resolution is in the signal to be generated.
In the prior art, therefore, an oscillator with a frequency fOSC is selected, whose resolution 1/fOSC is sufficiently fine for the required resolution for the signal with the frequency fsignal to be generated. If, for example, a signal with fsignal equal to 100 kHz and a resolution of 1%, i.e. the frequency can be set in 1% increments, is made available, an oscillator with an oscillator frequency of 100 kHz/1%=10 MHz is selected in the prior art.
The oscillator which is already provided as standard in a microcontroller with the frequency fOSC is often used in order to generate a signal with the frequency fsignal by the microcontroller. Correspondingly, the selection of the microcontroller is often geared to the integrated oscillator. In order to provide signals with a high frequency fsignal at the output of the microcontroller and, in addition to this, with a high resolution, it is therefore often necessary to deviate in favor of well equipped and therefore expensive microcontrollers.
It is known from the prior art to set the frequency fOSC of the signal which is made available by an oscillator via the calibration input of the oscillator. This is carried out once, before an electronic ballast provided therewith is first used and is used for the purpose of ensuring that different electronic ballasts provide comparable signals for the light sources to be connected thereto at the output of said ballasts.
DE 43 01 184 A1 has disclosed a control device for at least one discharge lamp, which control device has an inverter which is connected to a DC voltage source for changing, at a low frequency, the direction of current flow through the discharge lamp and a power controller, which is connected to a current sensor. The oscillator for the high frequency can be altered in terms of its high frequency by a control signal during operation, with it being possible, as a result, for the current flowing through an inductance and the discharge lamp to be switched on and off and to be kept constant by virtue of regulation of the pulse width of the resultant current. By virtue of the alteration of the high frequency of the oscillator, it is possible in this way to avoid instabilities which occur as a result of resonance phenomena. The oscillator is a conventional VCO (Voltage Controlled Oscillator), in which the frequency output thereby can be altered by varying the voltage applied to its control input. In addition to the control input, a VCO has a calibration input, with which the dependency between the applied voltage and the output frequency can be set. The problems mentioned at the outset result with such a control device.